from flask import Flask, render_template

app = Flask(__name__)


@app.route("/")
def index():
    my_int = 18
    my_str = "curry"
    my_list = [1, 5, 4, 3, 2]
    my_dict = {"name": "durant", "age": 28}

    # render_template方法:渲染模板
    # 参数1: 模板名称  参数n: 传到模板里的数据
    return render_template(
        "8.1_hello.html", my_int=my_int, my_str=my_str, my_list=my_list, my_dict=my_dict
    )


if __name__ == "__main__":
    any_ip = "0.0.0.0"
    http_port = 8088
    app.run(any_ip, http_port, debug=True)
